﻿<UserControl x:Class="ModernUILogViewer.Content.ContentLogEntryMessage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:view="clr-namespace:ModernUILogViewer.View"
             xmlns:business="clr-namespace:ModernUILogViewer.Business"
             xmlns:helper="clr-namespace:ModernUILogViewer.Elements.Helpers"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"                
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             
             >    
    <Grid>
        <TextBox                 
                HorizontalScrollBarVisibility="Auto" 
                VerticalScrollBarVisibility="Auto" 
                IsReadOnly="True" 
                Text="{Binding SelectedLogEntry.Message, Mode=OneWay}"                             
                x:Name="txtbox"                
            >                           
            <TextBox.Resources>                
                <business:DataContextSpy x:Key="spy" DataContext="{Binding ElementName=txtbox}" />
            </TextBox.Resources>            
            <TextBox.ContextMenu>
                <ContextMenu DataContext="{Binding Source={StaticResource spy}, Path=DataContext}">                    
                    <MenuItem Header="Copy text" Command="{x:Static view:ViewCommands.CopyTextToClipboard}" CommandParameter="{Binding Text}">
                        <MenuItem.Icon>
                            <Path Fill="#FF2B2B2B"
                              Width="14.3775"
                              Height="14"
                              Canvas.Left="0.311264"
                              Canvas.Top="0.500005"
                              Stretch="Fill"
                              Data="F1 M 27,20L 38.75,20L 37.75,19L 24,19L 24,50L 27,50L 27,20 Z M 46.25,20L 59,32.75L 59,59L 27,59L 27,54L 20,54L 20,15L 39.25,15L 44.25,20L 46.25,20 Z M 31,24L 31,55L 55,55L 55,37L 42,37L 42,24L 31,24 Z M 46,25.25L 46,33L 53.75,33L 46,25.25 Z " />
                        </MenuItem.Icon>
                    </MenuItem>                    
                </ContextMenu>
            </TextBox.ContextMenu>
        </TextBox>
        
    </Grid>
</UserControl>
